﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace BDSim
{
    public class RinexFileDLL
    {

        #region 写钟差文件
        /// <summary>
        /// 写钟差文件头
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="clkHead">钟差头结构</param>
        /// <returns> 是否写成功，1，成功；0不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteCLKHeader", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteCLKHeader(char[] FileName, ref RinexFileDataType.ClkHead clkHead);

        /// <summary>
        ///  写单时刻所有卫星数据
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="clkHead">钟差头结构</param>
        /// <param name="clkData">卫星钟差数据</param>
        /// <returns>是否写成功，1，成功；0不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteCLKREC", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteCLKREC(char[] FileName, ref RinexFileDataType.ClkData clkData);

        /// <summary>
        /// 写一天的钟差数据
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="clkHead">钟差头结构</param>
        /// <param name="DataGroup">钟差数据组数</param>
        /// <param name="clkData">卫星钟差数据</param>
        /// <returns>是否写成功，1，成功；0不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteWhloeCLK", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteWhloeCLK(char[] FileName, int DataGroup, ref RinexFileDataType.ClkDataAll clkDataList);

        /// <summary>
        /// 关闭动态库中打开的文件
        /// </summary>
        /// <returns></returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "FCloseWriteCLKREC", CallingConvention = CallingConvention.Cdecl)]
        public static extern int FCloseWriteCLKREC();
        #endregion

        #region 读钟差文件
        /// <summary>
        /// 打开文件，
        /// </summary>
        /// <param name="FileName">文件流标记</param>
        /// <returns>返回文件的流标记,返回0或负数标示打开文件失败，1为成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "CLKOpen", CallingConvention = CallingConvention.Cdecl)]
        public static extern int CLKOpen(char[] FileName);

        /// <summary>
        /// 读取文件的文件头（V3.00）
        /// </summary>
        /// <param name="streamID">文件流标记</param>
        /// <param name="hdr">输出文件头结构</param>
        /// <returns> 返回： 1：正确读取   0：文件流不正确</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "CLKReadHeader", CallingConvention = CallingConvention.Cdecl)]
        public static extern int CLKReadHeader(int streamID, out RinexFileDataType.ClkHead hdr);

        /// <summary>
        /// 读一个卫星的电文，连续调用可以依次读取下一个卫星的电文
        /// 返回: 1：正确读取 0：文件流不正确 -1：到达文件尾
        /// </summary>
        /// <param name="streamID">文件流标记</param>
        /// <param name="hdr">输出文件头结构</param>
        /// <param name="data">输出数据结构</param>
        /// <returns></returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "CLKReadRecoder", CallingConvention = CallingConvention.Cdecl)]
        public static extern int CLKReadRecoder(int streamID, out RinexFileDataType.ClkHead hdr, out RinexFileDataType.ClkData data);

        /// <summary>
        ///关闭文件流
        /// </summary>
        /// <param name="streamID"></param>
        /// <returns>返回值为1时，为正确；0或负数为失败</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "CLKClose", CallingConvention = CallingConvention.Cdecl)]
        public static extern int CLKClose(int streamID);

        /// <summary>
        /// 读取整个钟差文件（V3.00）
        /// </summary>
        /// <param name="FileName">文件名称</param>
        /// <param name="clkDataList">输出钟差数据</param>
        /// <returns> 返回： 1：正确读取   0：文件流不正确</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ReadWholeCLK", CallingConvention = CallingConvention.Cdecl)]
        public static extern int ReadWholeCLK(char[] FileName, out RinexFileDataType.ClkDataAll clkDataList);
        #endregion

        #region 写SP3文件
        /// <summary>
        /// 写SP3头文件
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="sp3Head">SP3头结构</param>
        /// <returns>是否写成功，1，成功；0不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteSP3Header", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteSP3Header(char[] FileName, RinexFileDataType.SP3Head sp3Head);

        /// <summary>
        ///  写单时刻所有卫星轨道
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="sp3Head">SP3头结构</param>
        /// <param name="sp3Data">单时刻所有卫星轨道</param>
        /// <param name="flag">0代表卫星数少于100颗，其他为大于等于100颗</param>
        /// <returns>是否写成功，1，成功；0不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteSP3REC", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteSP3REC(char[] FileName, RinexFileDataType.SP3Head sp3Head, RinexFileDataType.SP3Data sp3Data, int flag);

        /// <summary>
        /// 写1天的SP3数据
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="sp3Head">SP3头结构</param>
        /// <param name="sp3Data">所有卫星轨道</param>
        /// <returns>是否写成功，1，成功；0不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteWholeSP3", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteWholeSP3(char[] FileName, RinexFileDataType.SP3Head sp3Head, out RinexFileDataType.SP3Data sp3Data);

        [DllImport("RinexFileDLL.dll", EntryPoint = "FCloseWriteSP3REC", CallingConvention = CallingConvention.Cdecl)]
        public static extern int FCloseWriteSP3REC();
        #endregion

        #region 读SP3文件
        /// <summary>
        /// 打开SP3文件
        /// </summary>
        /// <param name="FileName"></param>
        /// <returns>返回文件的流标记,0或负数为失败，1为成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "SP3Open", CallingConvention = CallingConvention.Cdecl)]
        public static extern int SP3Open(char[] FileName);

        /// <summary>
        /// 读取观测值文件的文件头
        /// </summary>
        /// <param name="streamID">文件流标记</param>
        /// <param name="hdr">输出文件头结构</param>
        /// <returns>返回： 1：正确读取   0：文件流不正确</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "SP3ReadHeader", CallingConvention = CallingConvention.Cdecl)]
        public static extern int SP3ReadHeader(int streamID, out RinexFileDataType.SP3Head hdr);

        /// <summary>
        /// 读一个历元的SP3数据
        /// 连续调用可以依次读取下一个历元的SP3数据
        /// </summary>
        /// <param name="streamID">文件流标记</param>
        /// <param name="hdr">输出文件头结构</param>
        /// <param name="data">输出数据结构</param>
        /// <returns>返回: 1：正确读取 0：文件流不正确 -1：到达文件尾</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "SP3ReadRecoder", CallingConvention = CallingConvention.Cdecl)]
        public static extern int SP3ReadRecoder(int streamID, ref RinexFileDataType.SP3Head hdr, out RinexFileDataType.SP3Data data);

        /// <summary>
        /// 关闭文件流
        /// </summary>
        /// <param name="streamID"></param>
        /// <returns>返回值为1时，为正确;0或负数为错误</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "SP3Close", CallingConvention = CallingConvention.Cdecl)]
        public static extern int SP3Close(int streamID);

        /// <summary>
        /// 读整个SP3文件数据
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="data">SP3数据</param>
        /// <returns>是否成功打开文件，1，成功；0不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ReadWholeSP3", CallingConvention = CallingConvention.Cdecl)]
        public static extern int ReadWholeSP3(char[] FileName, out RinexFileDataType.SP3DataAll data);
        #endregion

        #region 写导航电文文件
        /*v2.10版本写*/
        /// <summary>
        /// 写导航电文文件头V2.10
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="navMessageHead">导航电文文件头结构</param>
        /// <returns>是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteNavHeader_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteNavHeader_V210(char[] FileName, RinexFileDataType.NavMessageHead navMessageHead);

        /// <summary>
        /// 写单时刻单颗星导航电文数据V2.10
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="navMessage">导航电文数据</param>
        /// <returns>是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteNavREC_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteNavREC_V210(char[] FileName, RinexFileDataType.NavMessage_Rinex navMessage);

        /// <summary>
        /// 写整个导航电文文件V2.10
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="navMessageHead">导航电文文件头结构</param>
        /// <param name="DataGroup">导航电文数据组数</param>
        /// <param name="navMessage">导航电文数据</param>
        /// <returns>是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteWholeNAV_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteWholeNAV_V210(char[] FileName, RinexFileDataType.NavMessageHead navMessageHead, int DataGroup, out RinexFileDataType.NavMessage_Rinex navMessage);

        /*v3.02版本写*/
        /// <summary>
        /// 写导航电文文件头V3.02
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="navMessageHead">导航电文文件头结构</param>
        /// <returns>是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteNavHeader_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteNavHeader_V302(char[] FileName, RinexFileDataType.NavMessageHead navMessageHead);

        /// <summary>
        /// 写单时刻单颗星导航电文数据V3.02
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="navMessage">导航电文数据</param>
        /// <returns>是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteNavREC_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteNavREC_V302(char[] FileName, RinexFileDataType.NavMessage_Rinex navMessage);

        /// <summary>
        /// 写整个导航电文文件V3.02
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="navMessageHead">导航电文文件头结构</param>
        /// <param name="DataGroup">导航电文数据组数</param>
        /// <param name="navMessage">导航电文数据</param>
        /// <returns>是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteWholeNAV_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool WriteWholeNAV_V302(char[] FileName, RinexFileDataType.NavMessageHead navMessageHead, int DataGroup, out RinexFileDataType.NavMessage_Rinex navMessage);

        [DllImport("RinexFileDLL.dll", EntryPoint = "FCloseWriteNavREC_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern int FCloseWriteNavREC_V210();

        [DllImport("RinexFileDLL.dll", EntryPoint = "FCloseWriteNavREC_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern int FCloseWriteNavREC_V302();
        #endregion

        #region 读导航电文文件
        /// <summary>
        /// 打开文件
        /// </summary>
        /// <param name="FileName"></param>
        /// <returns>返回文件的流标记,返回0或负数标示打开文件失败，1为成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "NavOpen", CallingConvention = CallingConvention.Cdecl)]
        public static extern int NavOpen(char[] FileName);

        /// <summary>
        /// 读取文件的文件头（V2.10） 
        /// </summary>
        /// <param name="streamID">文件流号</param>
        /// <param name="hdr">输出文件头结构</param>
        /// <returns>返回： 1：正确读取   0：文件流不正确</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "NavReadHeader_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern int NavReadHeader_V210(int streamID, out RinexFileDataType.NavMessageHead hdr);

        /// <summary>
        /// 读取文件的文件头（V3.02） 
        /// </summary>
        /// <param name="streamID">文件流号</param>
        /// <param name="hdr">输出文件头结构</param>
        /// <returns>返回： 1：正确读取   0：文件流不正确</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "NavReadHeader_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern int NavReadHeader_V302(int streamID, out RinexFileDataType.NavMessageHead hdr);

        /// <summary>
        /// 读一个历元的电文（V2.10）
        /// 连续调用可以依次读取下一个历元的电文
        /// </summary>
        /// <param name="streamID">文件流号</param>
        /// <param name="hdr">输出文件头结构</param>
        /// <param name="data">输出数据结构</param>
        /// <returns>返回: 1：正确读取 0：文件流不正确 -1：到达文件尾</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "NavReadRecoder_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern int NavReadRecoder_V210(int streamID, out RinexFileDataType.NavMessage_Rinex data);

        /// <summary>
        /// 读一个历元的电文（V2.10）
        /// 连续调用可以依次读取下一个历元的电文
        /// </summary>
        /// <param name="streamID">文件流号</param>
        /// <param name="hdr">输出文件头结构</param>
        /// <param name="data">输出数据结构</param>
        /// <returns>返回: 1：正确读取 0：文件流不正确 -1：到达文件尾</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "NavReadRecoder_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern int NavReadRecoder_V302(int streamID, out RinexFileDataType.NavMessage_Rinex data);

        /// <summary>
        ///关闭文件流
        /// </summary>
        /// <param name="streamID">文件流号</param>
        /// <returns>返回值为1时正确,0或负数为错误</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "NavClose", CallingConvention = CallingConvention.Cdecl)]
        public static extern int NavClose(int streamID);

        /// <summary>
        /// 读整个导航电文文件(V2.10)
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="navMsgWhole">导航电文文件结构体</param>
        /// <param name="DataGroup">导航电文数据组数</param>
        /// <returns>是否写成功，true，成功；false不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ReadWholeNAV_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool ReadWholeNAV_V210(char[] FileName, out RinexFileDataType.NavMsgAll navMsgWhole, out int DataGroup);

        /// <summary>
        /// 读整个东航电文文件（V3.02）
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="navMsgWhole">导航电文文件结构体</param>
        /// <param name="DataGroup">导航电文数据组数</param>
        /// <returns>是否写成功，true，成功；false不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ReadWholeNAV_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern bool ReadWholeNAV_V302(char[] FileName, out RinexFileDataType.NavMsgAll navMsgWhole, out int DataGroup);
        #endregion

        #region 写观测数据
        /*v2.10版写*/
        /// <summary>
        /// 写观测数据文件头v2.10
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="observeHead">观测数据文件头结构</param>
        /// <returns>文件是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteOBSHeader_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern int WriteOBSHeader_V210(char[] FileName, ref RinexFileDataType.ObserveHead observeHead);

        /// <summary>
        /// 写单时刻多颗星观测数v2.10
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="observeData">观测数据结构体</param>
        /// <param name="observeHead">观测数据文件头结构</param>
        /// <returns>文件是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteOBSREC_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern int WriteOBSREC_V210(char[] FileName, ref RinexFileDataType.ObserveData observeData, ref RinexFileDataType.ObserveHead observeHead);

        /// <summary>
        /// 写整个观测数据文件v2.10
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="observeHead">观测数据文件头结构</param>
        /// <param name="observeData">观测数据结构体</param>
        /// <param name="ObsTimeCount">数据组数</param>
        /// <returns>文件是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteWholeOBS_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern int WriteWholeOBS_V210(char[] FileName, out RinexFileDataType.ObserveHead observeHead, out RinexFileDataType.ObserveData observeData, int ObsTimeCount);

        /*v3.02版写*/
        /// <summary>
        /// 写整个观测数据文件v3.02
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="observeHead">观测数据文件头结构</param>
        /// <param name="observeData">观测数据结构体</param>
        /// <param name="ObsTimeCount">数据组数</param>
        /// <returns>文件是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteWholeOBS_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern int WriteWholeOBS_V302(char[] FileName, out RinexFileDataType.ObserveHead observeHead, out RinexFileDataType.ObserveData_v302 observeData, int ObsTimeCount);

        /// <summary>
        /// 写观测数据文件头v3.02
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="observeHead">观测数据文件头结构</param>
        /// <returns>文件是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteOBSHeader_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern int WriteOBSHeader_V302(char[] FileName, ref RinexFileDataType.ObserveHead observeHead);

        /// <summary>
        /// 写单时刻多颗星观测数v3.02
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="observeData">观测数据结构体</param>
        /// <param name="observeHead">观测数据文件头结构</param>
        /// <returns>文件是否写成功，1，成功；其余不成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "WriteOBSREC_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern int WriteOBSREC_V302(char[] FileName, ref RinexFileDataType.ObserveData_v302 observeData, ref RinexFileDataType.ObserveHead observeHead);

        [DllImport("RinexFileDLL.dll", EntryPoint = "FCloseWriteOBSREC_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern int FCloseWriteOBSREC_V210();

        [DllImport("RinexFileDLL.dll", EntryPoint = "FCloseWriteOBSREC_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern int FCloseWriteOBSREC_V302();
        
        #endregion

        #region 读观测数据
        /// <summary>
        /// 打开观测值文件，
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <returns>文件流号，返回0或负数标示打开错误，1运行成功</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ObsOpen", CallingConvention = CallingConvention.Cdecl)]
        public static extern int ObsOpen(char[] FileName);

        /// <summary>
        /// 读观测数据文件头v2.10
        /// </summary>
        /// <param name="streamID">文件流号</param>
        /// <param name="hdr">输出文件头结构</param>
        /// <returns>1为正确，0或负数为错误返回</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ObsReadHeader_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern int ObsReadHeader_V210(int streamID, out RinexFileDataType.ObserveHead hdr);

        /// <summary>
        /// 读观测数据文件头v3.02
        /// </summary>
        /// <param name="streamID">文件流号</param>
        /// <param name="hdr">输出文件头结构</param>
        /// <returns>1为正确，0或负数为错误返回</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ObsReadHeader_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern int ObsReadHeader_V302(int streamID, out RinexFileDataType.ObserveHead hdr);

        /// <summary>
        /// 读一个历元的观测值(V2.10)
        /// 连续调用可以依次读取下一个历元的观测值
        /// </summary>
        /// <param name="streamID">文件流号</param>
        /// <param name="hdr">文件头</param>
        /// <param name="rec">输出此历元观测记录值</param>
        /// <returns>1为正确返回,-1为到达文件尾，0为文件错误</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ObsReadRecoder_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern int ObsReadRecoder_V210(int streamID, ref RinexFileDataType.ObserveHead hdr, out RinexFileDataType.ObserveData rec);

        /// <summary>
        /// 读一个历元的观测值(V3.02)
        /// 连续调用可以依次读取下一个历元的观测值
        /// </summary>
        /// <param name="streamID">文件流号</param>
        /// <param name="hdr">文件头</param>
        /// <param name="rec">输出此历元观测记录值</param>
        /// <returns>1为正确返回,-1为到达文件尾，0为文件错误</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ObsReadRecoder_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern int ObsReadRecoder_V302(int streamID, ref RinexFileDataType.ObserveHead hdr, out RinexFileDataType.ObserveData_v302 rec);

        /// <summary>
        /// 关闭文件流
        /// </summary>
        /// <param name="streamID">文件流号</param>
        /// <returns>返回1为正确关闭,0或负数为错误</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ObsClose", CallingConvention = CallingConvention.Cdecl)]
        public static extern int ObsClose(int streamID);

        /// <summary>
        /// 读整个观测数据文件v2.10
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="obsDataAll">观测数据文件结构</param>
        /// <returns>文件是否读成功，1，成功；其余不成功<</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ReadWholeOBS_V210", CallingConvention = CallingConvention.Cdecl)]
        public static extern int ReadWholeOBS_V210(char[] FileName, out RinexFileDataType.ObsDataAll_v210 obsDataAll);//读整个文件

        /// <summary>
        /// 读整个观测数据文件v3.02
        /// </summary>
        /// <param name="FileName">文件名</param>
        /// <param name="obsDataAll">观测数据文件结构</param>
        /// <returns>文件是否读成功，1，成功；其余不成功<</returns>
        [DllImport("RinexFileDLL.dll", EntryPoint = "ReadWholeOBS_V302", CallingConvention = CallingConvention.Cdecl)]
        public static extern int ReadWholeOBS_V302(char[] FileName, out RinexFileDataType.ObsDataAll_v302 obsDataAll);//读整个文件
        #endregion


    }
}
